home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-02-26 | 2.8 KB | 111 lines |
- ' *************************************************************
- '
- ' Line Copy
- '
- ' - ** By Paul Nordovics ** -
- '
- ' If you use this in your own programs I won't be offended if
- ' you mention me in your creditz !!!
- ' *************************************************************
- '
- ' line_copy11[source,sx1,sy1,sx2,sy2,dest,dx1,dy1,speed,_direction]
- '
- ' source = screen number where image is
- ' sx1,sy1 = co-ords of top-left corner of area to be copied
- ' sx2,sy2 = co-ords of bottom-right corner of area to be copied
- ' dest = screen number where image is being copied to
- ' dx1,dy1 = co-ords of top-left corner where image is being copied to
- ' speed = speed of fx
- ' _direction: 0 = top 2 bottom
- ' 1 = bottom 2 top
- ' 2 = left 2 right
- ' 3 = right 2 left
- '
- ' *************************************************************
- '
- Hide
- ' ********************
- ' set up source screen
- ' ********************
- Unpack 1 To 0
- '
- ' *************************
- ' set up destination screen
- ' *************************
- Screen Open 1,320,256,16,Lowres
- Curs Off : Flash Off
- Get Palette 0
- Cls 0 : Paper 0
- '
- Do
- For K=0 To 3
- Cls 0
- LINE_COPY1[0,32,33,290,188,1,32,33,1,K]
- Wait 25
- Next K
- Loop
- '
- End
- '
- Procedure LINE_COPY1[SOURCE,SX1,SY1,SX2,SY2,DEST,DX1,DY1,SPEED,_DIRECTION]
- ' ************
- ' top 2 bottom
- ' ************
- If _DIRECTION=0
- For _LOOP=0 To 1
- DY=DY1+_LOOP
- For K=SY1+_LOOP To SY2 Step 2
- Screen Copy SOURCE,SX1,K,SX2+1,K+1 To DEST,DX1,DY
- Add DY,2
- If SPEED>0
- Wait SPEED
- End If
- Next K
- Next _LOOP
- End If
- ' ************
- ' bottom 2 top
- ' ************
- If _DIRECTION=1
- For _LOOP=0 To 1
- DY=DY1+(SY2-SY1)-_LOOP
- For K=SY2-_LOOP To SY1 Step -2
- Screen Copy SOURCE,SX1,K,SX2+1,K+1 To DEST,DX1,DY
- Add DY,-2
- If SPEED>0
- Wait SPEED
- End If
- Next K
- Next _LOOP
- End If
- ' ************
- ' left 2 right
- ' ************
- If _DIRECTION=2
- For _LOOP=0 To 1
- DX=DX1+_LOOP
- For K=SX1+_LOOP To SX2 Step 2
- Screen Copy SOURCE,K,SY1,K+1,SY2+1 To DEST,DX,DY1
- Add DX,2
- If SPEED>0
- Wait SPEED
- End If
- Next K
- Next _LOOP
- End If
- ' ************
- ' right 2 left
- ' ************
- If _DIRECTION=3
- For _LOOP=0 To 1
- DX=DX1+(SX2-SX1)-_LOOP
- For K=SX2-_LOOP To SX1 Step -2
- Screen Copy SOURCE,K,SY1,K+1,SY2+1 To DEST,DX,DY1
- Add DX,-2
- If SPEED>0
- Wait SPEED
- End If
- Next K
- Next _LOOP
- End If
- End Proc